package cn.xiaopengstack.domain.rebate.repository;

import cn.xiaopengstack.domain.rebate.model.aggregate.BehaviorRebateAggregate;
import cn.xiaopengstack.domain.rebate.model.entity.BehaviorRebateOrderEntity;
import cn.xiaopengstack.domain.rebate.model.entity.DailyBehaviorRebateEntity;
import cn.xiaopengstack.types.event.BaseEvent;

import java.util.List;

/**
 * @author jiangyangang
 */
public interface IBehaviorRebateRepository {

    /**
     * 查询每日返利配置
     * @param behaviorType
     * @return
     */
    List<DailyBehaviorRebateEntity> queryDailyBehaviorRebateListByType(String behaviorType);

    /**
     * 保存每日返利订单
     * @param aggregates
     */
    void saveDailyRebateOrder(List<BehaviorRebateAggregate> aggregates);

    /**
     * 发送MQ
     * @param event
     */
    boolean sendDailyRebateMessage(BaseEvent<?> event);

    /**
     * 查询单号记录
     * @param userId
     * @param businessNo
     * @return
     */
    List<BehaviorRebateOrderEntity> queryOrderByOutBusinessNo(String userId, String businessNo);
}
